Repository navigation
Run the CLA check without pull_request_target - #5
Conversation
GitHub blocks pull_request_target by default in public repositories without an Actions event policy. The status-context and head-sha inputs let a workflow_run workflow, triggered by a secret-free pull_request workflow, check the open pull request whose head is the triggering commit and report a commit status on it. Signing by comment updates the status directly instead of rerunning a workflow. Without status-context the action behaves as before.
…mode A status belongs to the commit, so pull requests that share a head get an error status instead of one pull request's result. A check that overlaps a signature write runs again, so a stale failure does not outlast the signing run's success. An unsigned result fails only the status; errors, including a rejected signature write, set an error status and fail the job. Comments on closed pull requests are ignored, and head-sha is required with status-context outside issue_comment.
There was a problem hiding this comment.
🟡 Changes recommended
Two moderate active issues remain in status-mode error handling: pull-request lookup failures can leave the required status pending, and unreadable content versions can allow a stale failure to be posted without retrying or failing closed.
2 open issues
What changed in this PR
This PR adds an optional commit-status mode for CLA checks, allowing them to run from workflow_run and issue_comment workflows without relying on pull_request_target, while preserving existing behavior when the new inputs are unused.
Changes:
- Added
status-contextandhead-shainputs with pull-request lookup by head commit and commit-status reporting. - Added shared-head detection, head-movement checks, and bounded retries for signature changes.
- Updated source, documentation, tests, fake GitHub helpers, changelog, and the bundled action.
- Review findings include three moderate issues in
src/statusMode.tsand one documentation nit indocs/open-waters.md.
| File | Summary |
|---|---|
src/statusMode.ts |
Implements status-mode pull-request lookup, validation, status reporting, retries, and comment-event support. |
src/shared/getInputs.ts |
Reads the new status-mode inputs. |
src/setupClaCheck.ts |
Returns check results and adapts signing, rerun, and error handling for status mode. |
src/main.ts |
Validates inputs and dispatches status-mode execution. |
src/graphql.ts |
Verifies the pull-request head while collecting commit authors. |
README.md |
Documents status-mode usage and inputs. |
docs/open-waters.md |
Describes the replacement workflow architecture, setup, and limitations. |
dist/index.js |
Rebuilt bundled action implementation. |
CHANGELOG.md |
Records the new status-mode functionality. |
action.yml |
Declares and documents the new action inputs. |
__tests__/testHelpers/fakeGithubCore.ts |
Adds fake pull-request listing, head metadata, and commit-status support. |
__tests__/testHelpers/context.ts |
Keeps test issue context synchronized with dynamically loaded pull requests. |
__tests__/main.test.ts |
Adjusts input mocks for the new status-mode inputs. |
__tests__/integration/statusMode.test.ts |
Covers lookup, status outcomes, races, signing, errors, and edge cases. |
Review effort: Lite
…versions A failed pull request lookup now posts an error status on the requested head instead of leaving the required status pending. An unreadable signatures file version counts as changed, so two failed reads cannot settle a stale failure.
There was a problem hiding this comment.
🔵 Needs a closer look
Approval should wait for documented consumer-repository end-to-end validation of the new privileged event path, including fork-head status creation, token permissions, and required-check ruleset behavior.
No open issues 🎉
2 resolved since last review
Review effort: Lite
A missing signatures file counts as a version of its own, so creating it triggers one more pass that reports the unsigned result. A file that cannot be read ends the run after an error instead of repeating it. A failure to post the lookup-error status no longer hides the lookup error.

GitHub now blocks
pull_request_targetby default in public repositories that have no Actions event policy, and setting one needs GitHub Team. The block becomes permanent on December 2, 2026. This lets the CLA check run withoutpull_request_target, from aworkflow_runworkflow.With the new
status-contextinput, the action reports its result as a commit status on the pull request's head commit instead of through its own job, which in aworkflow_runorissue_commentworkflow is attached to the default branch. The newhead-shainput names the commit, normallygithub.event.workflow_run.head_sha. The action then lists open pull requests through the API and checks the one whose head is that commit. It reads nothing from the triggering run, so there is no artifact, PR number or branch name to trust. Signing by comment sets the status on the pull request's current head directly, without rerunning a workflow.Without
status-contextthe action behaves as before, sopull_request_targetworkflows keep working.Consumer setup
docs/open-waters.md describes the pair of workflows:
CLA triggerruns onpull_requestwith no permissions or secrets and does nothing. Its completion is the signal. Its job must not be namedcla.claand passes, since Dependabot's runs may not get the App secret.CLAruns onworkflow_runwhenCLA triggercompletes, except for Dependabot's runs, and on comments. It mints the App token as before, addsstatuses: write, dropsactions: write, and passesstatus-context: claandhead-sha.The status is created with
GITHUB_TOKEN, so its source is GitHub Actions, which is what water-levels' and aiscast'sprotect-mainrulesets require forcla.Races and shared heads
headRefOid. If it no longer matches the commit being checked, the action postserroron the old commit instead of a result for commits it did not read.errorinstead of one pull request's result. Closing the copy and pushing or commentingrecheckclears it..cla.jsoncounts as a change, so the first check in a new repository ends withfailure.An unsigned result fails only the status, so the default branch's commit does not show a failed CLA job for every unsigned pull request. Errors, including a rejected signature write, post
errorand fail the job.In status mode the PR opener is now loaded on comment runs too, so
require-opener-as-authorapplies there as it does on pull request runs.Tests
__tests__/integration/statusMode.test.tscovers lookup by head, pass and fail statuses, the opener check, stale and closed heads, shared heads on both paths, the head moving mid-check, a signature landing mid-check, a rejected signature write, signing by comment, and missing or misplaced inputs. The fake GitHub gained pull request listing, commit statuses andheadRefOid.npm run lint,npm testandnpm run buildpass, anddist/is rebuilt.Known limitations
pull_requestruns from some first-time contributors wait for a maintainer's approval, and GitHub runs nopull_requestworkflow while a pull request has merge conflicts. The CLA comment and status wait for those; arecheckcomment runs the check without them.pull_requestruns use the pull request's own workflow files, so a pull request can add a job namedclathat passes, and a required check sourced from GitHub Actions cannot tell it apart. This was already possible withpull_request_target. The docs describe how to close it by having the CLA App post the status; see Follow-ups.clastatus toerroruntil a maintainer closes the copy.workflow_runandissue_commentonly run workflows on the default branch, so the first real run needs a consumer PR merged.After merge
recheckpaths all set theclastatus, and the required check accepts it.Follow-ups
clastatus, so a pull request's own job namedclacannot satisfy the required check. That needs the App's Commit statuses permission and a ruleset change in each repository, and no change to this action.closed-pr.ymlalso runs onpull_request_target.Review
Three local rounds.
errorfor shared heads. Three found that a slow run could overwrite a signing run's success with a stale failure; fixed by checking again when the signatures file changed. Two found that status mode withouthead-shapassed silently; it now fails. Codex found that a pull request can add its own passingclajob; this predates the change and is documented above with a fix that needs settings changes. Also fixed: comments on closed pull requests, docs, changelog. Dismissed: the README's example column forhead-shais an example, not a default.failurewith a green job. Both fixed with tests. Dismissed: a signing run's own write triggers one extra pass, which is bounded and harmless.head-shawithoutstatus-contextis now rejected. The missing-fileerrorand the per-run listing cost are listed as limitations.The reviews were static. Tests, lint and build ran after each round's fixes; no model review ran after the round 3 doc and input fixes.
After the PR opened, Copilot found that a failed pull request lookup left the required status pending and that two unreadable version reads looked unchanged. Both are fixed with tests. A fourth Claude Opus and Sonnet round on that fix found no defects; its low findings led to separating a missing signatures file from an unreadable one, so a broken file no longer repeats
errorthree times, and to keeping the lookup error when posting its status fails. Tests, lint and build ran after those changes; no model review ran after them.